local function ClosePlayer(inst)
    local player = inst:GetNearestPlayer(true)
    if player and inst.sg:HasStateTag("trapped") == false then
        return BufferedAction(inst, player, ACTIONS.GOHOME)
    end
end

local ClownBabbitBrain = Class(Brain, function(self, inst)
    Brain._ctor(self, inst)
end)

function ClownBabbitBrain:OnStart()
    local root =
        PriorityNode(
        {
            WhileNode(function() return true end, "boom",
            DoAction(self.inst, ClosePlayer, "boom", true ))
        }, .25)

    self.bt = BT(self.inst, root)
end

return ClownBabbitBrain
